@use 'design-system' as *;

.grid {
    width: 600px;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    pointer-events: none;

    @media screen and (max-width: $breakpoint-pricing-large) {
        width: 100%;
    }
}

.gridColumns {
    display: flex;
    flex-direction: row;
    justify-content: space-between;

    @media screen and (max-width: $breakpoint-pricing-large) {
        flex-direction: column;
    }
}

.label {
    color: var(--color-fg-secondary);
    font-weight: var(--text-semibold);
    padding-bottom: 12px;
    font-size: var(--text-fs-base);
    opacity: 0.8;
    display: flex;
    flex-direction: row;
    gap: $spacing-size-2;

    svg {
        transform: scale(0.8);
        opacity: 0.6;
    }
}

.optionsColumns {
    display: flex;
    gap: $spacing-size-12;
    flex-direction: column;
    margin-top: $spacing-size-12;
}

.themeOptions {
    padding-bottom: $spacing-size-5;
    border-bottom: 1px solid var(--color-border-secondary);

    @media screen and (max-width: $breakpoint-pricing-large) {
        border-bottom: none;
    }
}

.spacingOptions {
    .buttonGroup {
        display: flex;
        padding: 4px;
        background-color: var(--color-util-brand-50);

        border-radius: 8px;
        gap: 2px;

        button {
            flex: 1;
            padding: 8px 16px;
            border: none;
            background: transparent;
            border-radius: 6px;
            color: var(--text-color-secondary);
            font-size: var(--text-fs-base);
            font-weight: var(--text-semibold);
            cursor: pointer;
            transition: all 0.2s ease;

            box-shadow: none;

            &:hover:not(.active) {
                background-color: rgba(255, 255, 255, 0.164);
            }

            &.active {
                background-color: var(--color-bg-primary);
                color: var(--color-util-brand-500);
                box-shadow: var(--shadow-sm);

                #{$selector-darkmode} & {
                    background-color: var(--color-brand-200);
                }
            }
        }

        #{$selector-darkmode} & {
            background-color: color-mix(in srgb, var(--color-brand-50), var(--color-bg-primary) 90%);
            color: white;
        }
    }

    @media screen and (max-width: $breakpoint-pricing-large) {
        display: none;
    }
}

@media screen and (min-width: $breakpoint-pricing-large) {
    .gridCodeBlock {
        min-height: 580px;
    }
}

.codeBlockWrapper {
    position: relative;
    background-color: #111a4a;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: auto;
    left: -100px;
    bottom: 50px;
    box-shadow: var(--shadow-md);

    @media screen and (max-width: $breakpoint-pricing-large) {
        display: none;
    }

    code {
        --color-code-function: var(--color-brand-200);

        background-color: #111a4a !important;
        border: none;
        font-weight: 600 !important;

        .line-numbers-rows {
            border-right: none !important;
        }

        #{$selector-darkmode} & {
            background-color: color-mix(in srgb, var(--color-white), var(--color-bg-primary) 90%) !important;
        }
    }

    #{$selector-darkmode} & {
        background-color: color-mix(in srgb, var(--color-white), var(--color-bg-primary) 90%);
    }

    pre {
        height: 100%;
        margin: 26px 0 16px 0;
        border: none;
    }
}

.windowControls {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
}

.codeBlock {
    background: #111a4a;
    border: none;
    color: var(--color-white);
    margin: 0;
    white-space: pre-wrap;
    #{$selector-darkmode} & {
        background-color: color-mix(in srgb, var(--color-white), var(--color-bg-primary) 90%);
    }

    padding: 0;
    padding-top: 10px;
}

.lineNumbers {
    color: rgba(255, 255, 255, 0.6);
    margin-right: 16px;
    text-align: right;
    user-select: none;
    margin-top: 35px;
    font-size: 15px;
}

.commentLine {
    opacity: 0.5;
}

.themeOptions {
    .buttonGroup {
        display: flex;
        flex-direction: column;
        justify-content: left;

        gap: 16px;
        width: 510px;
        @media screen and (max-width: $breakpoint-pricing-large) {
            width: 100%;
        }

        .buttonItem {
            padding: $spacing-size-5;
            border-radius: var(--radius-md);
            cursor: pointer;
            display: flex;
            gap: $spacing-size-2;
            flex-direction: column;
            border: 1px solid transparent;

            &:hover {
                color: var(--color-fg-primary);
            }
        }
    }

    .active {
        justify-content: left;
        background-color: var(--color-util-brand-50);
        color: var(--color-util-brand-500);
        border: 1px solid var(--color-util-brand-200) !important;
        box-shadow: var(--shadow-xs);

        .title {
            color: var(--color-util-brand-500);

            #{$selector-darkmode} & {
                color: var(--color-fg-primary);
            }
        }

        #{$selector-darkmode} & {
            color: var(--color-white);
            background-color: color-mix(in srgb, var(--color-white), var(--color-bg-primary) 90%);
            border: 1px solid rgba(255, 255, 255, 0.1) !important;
        }
    }
}

.inputLabel {
    display: flex;
    align-items: center;
    gap: 0 $spacing-size-2;

    span {
        font-weight: var(--text-semibold);
    }
}

.description {
    font-weight: var(--text-regular);
    color: var(--color-text-tertiary);
    opacity: 0.8;
    padding-left: 2.8ch;

    #{$selector-darkmode} & {
        opacity: 0.9;
    }
}

.title {
    font-weight: var(--text-semibold);
}

.frameworkSwitcher {
    display: flex;
    flex-direction: row;
    justify-content: left;
    gap: $spacing-size-3;
    margin: $spacing-size-2;

    svg {
        height: 24px;
        width: 24px;
    }

    svg {
        path {
            fill: rgba(255, 255, 255, 0.3);
        }
    }

    svg:hover {
        cursor: pointer;
        path {
            fill: rgba(255, 255, 255, 1);
        }
    }

    .active {
        path {
            fill: white;
        }
    }
}
